package com.cnjson.sensor.db.service;

import com.cnjson.sensor.db.entity.Equipment;
import com.cnjson.sensor.db.utils.DaoUtils;

/**
 * @Author: zhy
 * @email: 1269679946@qq.com
 * @Date: 2018/12/31
 * @DESC： 设备管理服务
 */
public class EquipmentService {

    /**
     * 根据equipment_id查询设备详细信息
     * @param equipmentId
     * @return Equipment
     */
    public Equipment getEuipment(String equipmentId) {
        Equipment equipment = new Equipment();
        String sql = "SELECT name From ift_equipment_status WHERE equipment_id = ?";
        Object result = DaoUtils.getValue(sql, equipmentId);
        equipment.setName(result.toString());
        String sql2 = "SELECT scene_id From ift_equipment_status WHERE equipment_id = ?";
        result = DaoUtils.getValue(sql, equipmentId);
        equipment.setSceneId(result.toString());
        return equipment;
    }



}
